//
//  UIViewVC.swift
//  HHSwift
//
//  Created by 华宏 on 2020/5/16.
//  Copyright © 2020 huahong. All rights reserved.
//

import UIKit

class UIViewVC: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let view1 = UIView(frame: CGRect(x: 100, y: 100, width: 200, height: 200))
        view1.backgroundColor = .red
        view.addSubview(view1)
        
        //view1 是否是 self.view 的子视图
        let isDescendant =  view1.isDescendant(of: self.view)
        if isDescendant == true {
            print("view1 是 self.view 的子视图")
        }else
        {
            print("view1 不是 self.view 的子视图")
        }
        
    }
    

   

}
